package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.AlarmDao;
import cn.topevery.garden.entity.po.Alarm;
import cn.topevery.garden.entity.query.AlarmQuery;
import cn.topevery.garden.entity.vo.AlarmVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 *
 * @author code-generate
 * @date 2022-01-07
 */
@Service
public class AlarmLogic extends BaseLogic<Alarm> {
    @Autowired
    AlarmDao alarmDao;

    @Override
    public BaseEntityDao<Alarm, Integer> getDao() {
        return alarmDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<AlarmVO> listPage(AlarmQuery query) {
        return alarmDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        alarmDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param alarm 实体
     */
    public void saveOrUpdate(String userId, Alarm alarm){
        alarmDao.saveOrUpdate(userId,alarm);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public Alarm getEntityByColumn(String key, String value) {
        return alarmDao.getEntityByColumn(key, value);
    }



    public Integer szcgEvtAlarmEntry() {
        return alarmDao.szcgEvtAlarmEntry();
    }

    public Integer ocaEvtAlarmEntry() {
        return alarmDao.ocaEvtAlarmEntry();
    }

    public Integer disastersAlarmEntry() {
        return alarmDao.disastersAlarmEntry();
    }

    public Integer szcgEvtAlarmEnd() {
        return alarmDao.szcgEvtAlarmEnd();
    }
}
